<template>
	<view class="__inner flex">
		<grzxnav :Index="selectedIndex"  @index="subassembly_index"></grzxnav>
		<!-- <view class="ml-4 pt-4"> -->
		<view class="right flex-1">
			<!-- 个人中心首页 -->
			<grzxsy v-if="selectedIndex === 0"></grzxsy>

			<!-- 已买到的货品 -->
			<grzxArrived v-if="selectedIndex === 1"></grzxArrived>

			<!-- 摘牌的采购单 -->
			<goodssold v-if="selectedIndex === 2"></goodssold>

			<!-- 退货退款 -->
			<!-- <grzxReturn v-if="selectedIndex === 3"></grzxReturn> -->

			<!-- 代发批量下单 -->
			<!-- <overbooking v-if="selectedIndex === 4"></overbooking> -->

			<!-- 收藏夹 -->
			<!-- <favorites v-if="selectedIndex === 5"></favorites> -->

			<!-- 优惠券 -->
			<!-- <coupons v-if="selectedIndex === 6"></coupons> -->

			<!-- 地址管理 -->
			<!-- <deliveryaddress :Address="Address" v-if="selectedIndex === 7"></deliveryaddress> -->

			<!-- 修改密码 -->
			<password v-if="selectedIndex === 3"></password>

			<!-- 员工列表 -->
			<businesslistings v-if="selectedIndex === 4"></businesslistings>

			<!-- 消息列表 -->
			<messagelist :activeName="activeName"  @Black="Black" v-if="selectedIndex === 5"></messagelist>

			<!-- 我的采购 -->
			<procure @myPurchase="myPurchase" @messagelist="messagelist" v-if="selectedIndex === 6"></procure>

			<!-- 我的销售 -->
			<presell @mySupply="mySupply" @messagelist="messagelist" v-if="selectedIndex === 7"></presell>

			<!-- 客服中心 -->
			<customer v-if="selectedIndex === 8"></customer>

			<!-- 供应大厅 -->
			<Supply @Black="Black" v-if="selectedIndex === 9"></Supply>

			<!-- 采购大厅 -->
			<Purchase @Black="Black" v-if="selectedIndex === 10"></Purchase>

			<!--  -->
			<Orderfinancing @Black="Black" v-if="selectedIndex === 11"></Orderfinancing>

			<!--  -->
			<browsinghistory @Black="Black" v-if="selectedIndex === 12"></browsinghistory>

			<!-- 我的采购 -->
			<mySupply @Black="Black" v-if="selectedIndex === 14"></mySupply>

			<myPurchase  @Black="Black" v-if="selectedIndex === 15"></myPurchase>
		</view>
	</view>
</template>

<script>
	import grzxnav from "./view/grzxnav.vue";
	import grzxsy from "./view/grzxsy.vue";
	import grzxArrived from "./view/grzxArrived.vue";
	import grzxReturn from "./view/grzxReturn.vue";
	import overbooking from "./view/overbooking.vue";
	import favorites from "./view/favorites.vue";
	import coupons from "./view/coupons.vue";
	import deliveryaddress from "./view/delivery_address.vue";
	import password from "./view/password.vue";
	import businesslistings from "./view/businesslistings.vue";
	import messagelist from "./view/messagelist.vue";
	import goodssold from "./view/goods_sold.vue";
	import procure from './view/procure.vue';
	import presell from './view/presell.vue';
	import customer from './view/customer.vue'
	import mySupply from './view/mySupply.vue'
	import myPurchase from './view/myPurchase.vue'
	import Supply from './view/Supply.vue'
	import Purchase from './view/purchase.vue'
	import Orderfinancing from './view/Orderfinancing.vue'
	import browsinghistory from './view/browsinghistory.vue'
	import {
		CityData
	} from "../../static/js/city.js";
	const {
		Address
	} = CityData();
	export default {
		data() {
			return {
				Address: Address(),
				scrollLeft: 0,
				selectedIndex:0,
				activeName:''
			};
		},
		components: {
			grzxnav,
			grzxsy,
			grzxArrived,
			grzxReturn,
			overbooking,
			favorites,
			coupons,
			deliveryaddress,
			password,
			businesslistings,
			messagelist,
			goodssold,
			procure,
			presell,
			customer,
			mySupply,
			myPurchase,
			Supply,
			Purchase,
			Orderfinancing,
			browsinghistory
		},
		props:{
			Index:{
				type:Number,
				default:0
			}
		},
		mounted() {
			if(this.Index!=0){
				this.subassembly_index(parseInt(this.Index))
			}
		},
		methods: {
			subassembly_index(i) {
				this.selectedIndex = i;
			},
			mySupply() {
				this.selectedIndex = 14
			},
			Black(e) {
				this.selectedIndex = e
				this.activeName = ''
			},
			myPurchase(){
				this.selectedIndex = 15
			},
			messagelist(e){
				this.selectedIndex = 5
				this.activeName = e
			}
		},
	};
</script>

<style lang="scss" scoped>

	.grzx {
		position: relative;
		padding: 0 0 80rpx 0;
		min-height: 1300rpx;
	}

	.right {
		margin: 40rpx 0 0 40rpx;
	}
</style>